<?php
class Staticizer_News_Index_Recommend extends Staticizer
{
    public function Build($param=NULL)
    {
        #获取数据
        $data=DB::GetRows('select ID,ClassID,Title,Datetime,M_HTMLFile from News where M_IsRecommend=TRUE order by M_IsRecommend_Datetime desc,Datetime desc limit 0,4');

        #处理数据
        foreach ($data as &$row)
        {            
            $row['ClassName']=DAO_NewsClass::GetNameByID($row['ClassID']);
            $row['M_HTMLFile']=Config::PATH_RELATIVE_CONTENT_NEWS.'/'.$row['M_HTMLFile'];            
        }

        #绑定模块
        View::Assign('News',$data);

        #生成静态
        $this->Save('news/index/recommend.html',View::Fetch('news/index/recommend.tpl'));
    }
}
?>